//
//  DetailTableViewCell.m
//  一点互助
//
//  Created by rimi on 16/9/2.
//  Copyright © 2016年 zhangboqiu. All rights reserved.
//

#import "DetailTableViewCell.h"
#import "UserModel.h"
#import "AddFriendsViewController.h"
#import "MemberViewController.h"

@implementation DetailTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}
- (IBAction)addFriendsBtnTaped:(id)sender {
    UserModel *user = [UserModel sharedUserModel];
    if (user.islogin) {
        AddFriendsViewController *vc = [[AddFriendsViewController alloc]init];
        vc.idStr = self.idStr;
        vc.nickName = self.niceName;
        vc.mobile = self.mobile;
        [self.ownerVC.navigationController pushViewController:vc animated:YES];
    }else{
        MemberViewController *vc = [[MemberViewController alloc]init];
        [self.ownerVC.navigationController pushViewController:vc animated:YES];
    }
}
-(void)layoutSubviews{
    [super layoutSubviews];

}
-(CGRect)heightForText:(NSString *)text{
    CGRect rect = [text boundingRectWithSize:CGSizeMake(kScreenWidth, 200 * kScreenHeightScale) options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil];
    rect.size.height = rect.size.height + 20 * kScreenHeightScale;
    self.detailLabel.frame = rect;
    self.rect = rect;
    return rect;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
